package com.wn32.main.demo;

public class demo {
    public static void main(String[] args) {
        String[] arr={"张三","李四","王五","赵六","赵六","赵六","赵六","赵六"};
        int count=0;
        String tmp="";
        for (String s : arr) {
            int count1 = getCount(s, arr);
            if(count1>count){
                count=count1;
                tmp=s;
            }
        }
        System.out.println("出现最多的是:"+tmp+",出现了:"+count);
    }
    public static int getCount(String str,String[] arr){
        int count=0;
        for (String s : arr) {
            if(str.equals(s)){
                count++;
            }
        }
        return count;
    }
}
